<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/" />
	<title>禾米租房 - 用户管理</title>
	<link type="text/css" rel="stylesheet" href="css/style.css" />
	<script type="text/javascript">
		function toUrl(url){
			window.location.href = url;
			return;
		}
		function update(id){
			document.location = 'user/modify?id=' + id;
		}
		function del(id) {
		var flag=	confirm("确认删除该条房屋记录！");
		if(flag){
			window.location="user/delete?id="+id;
		}
			
		}
	</script>
</head>
<body>
<div id="header" class="wrap" style="margin-top: 10px;">
	<div id="logo"><img src="images/logo.gif" /></div>
	<div class="search">
	<label class="ui-green"><input onclick="toUrl('home');" type="button" name="search" value="首页" /></label>	
		<label class="ui-green"><input onclick="toUrl('dispatcher?target=add');" type="button" name="search" value="发布房屋信息" /></label>	
		<label class="ui-green"><input type="button" name="search" value="退       出" onclick='document.location="logout"'/></label>
	</div>
</div>
<div class="main wrap">
	<table class="house-list">
	<c:if test="${!empty requestScope.list.result  }">
	<c:forEach var="result" items="${requestScope.list.result}" >
		<tr>
		
			<td class="house-thumb"><span>
				<a href="details?id=${result.id }"><img src="images/thumb_house.gif" /></a>
			</span>	</td>
			<td>
				<dl>
					<dt>
				<a href="details?id=${result.id }">${result.title}</a>
				</dt>
					<dd>
						${result.distict_name}区
						${result.street_name}，
						${result.floorage}平米<br/>
						联系方式: ${result.contact}

					</dd>
				</dl>
			</td>
			<%-- <c:if test="publisher.id==user.id"> --%>
			<td class="house-type"><label class="ui-green"><input type="button" onclick="update(${result.id})" name="search" value="修    改" /></label></td>
			<td class="house-price"><label class="ui-green"><input type="button" onclick="del(${result.id})" value="删    除" /></label></td>
			<%-- </c:if> --%>
			<!-- <s:else><td colspan="2"></td></s:else> -->
		</tr>
	</c:forEach>
	</c:if>
	<c:if test="${empty requestScope.list.result  }"><td>暂无发布房屋信息！立即发布吧！</td></c:if>
	
	</table>
	<c:if test="${!empty requestScope.list.result  }">
	<div class="pager">
		<ul>
			<li class="current">
			<a href="user/manage?currPage=1">首页</a></li>
			<li>
			<a href='user/manage?currPage=${requestScope.list.prevPage }'>上一页</a></li>
			<li>
			<a href='user/manage?currPage=${requestScope.list.nextPage }'>下一页</a></li>
			<li>
			<a href='user/manage?currPage=${requestScope.list.totalPage}'>末页</a></li>
		</ul>
		<span class="total">${requestScope.list.currPage}/${requestScope.list.totalPage}页</span>
	</div>
	</c:if>
</div>
<div id="footer" class="wrap">
	<dl>
    	<dt>禾米租房 &copy; 2010 禾米教育 浙ICP证1000001号</dt>
        <dd>关于我们 · 联系方式 · 意见反馈 · 帮助中心</dd>
    </dl>
</div>
</body>
</html>
